<template>
  <!-- 雷达图 -->
  <div>
    <div id="radar" ref="myChart" />
  </div>
</template>

<script>
import * as echarts from 'echarts'

export default {
  mounted() {
    // 2. 传入 dom 初始化示例
    const chart = echarts.init(this.$refs.myChart)

    // 3. 画图
    chart.setOption({
      color: ['red', 'blue', '#0f0'],
      textStyle: {
        fontSize: 16
      },
      radar: {
        // shape: 'circle',
        indicator: [
          { name: '销售', max: 6500 },
          { name: '利润', max: 16000 },
          { name: '留存率', max: 30000 },
          { name: '退货率', max: 38000 },
          { name: '售后', max: 52000 },
          { name: '市场', max: 25000 }
        ]
      },
      series: [{
        name: '预算 vs 开销（Budget vs spending）',
        type: 'radar',
        data: [
          {
            value: [6500, 3000, 20000, 35000, 50000, 18000],
            name: '上海营业部'
          },
          {
            value: [5000, 14000, 28000, 26000, 42000, 21000],
            name: '广州营业部'
          },
          {
            value: [1000, 17000, 2000, 20000, 12000, 21000],
            name: '北京营业部'
          }
        ]
      }]
    })
  }
}
</script>

<style lang="scss" scoped>
#radar {
  width: 600px;
  height: 400px;
}
</style>
